USE [NANS21V]
GO

/****** Object:  UserDefinedFunction [dbo].[Tyakudori]    Script Date: 04/24/2014 13:40:55 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Tyakudori]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[Tyakudori]
GO

USE [NANS21V]
GO

/****** Object:  UserDefinedFunction [dbo].[Tyakudori]    Script Date: 04/24/2014 13:40:55 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE FUNCTION [dbo].[Tyakudori]
(
	@TYAKUDORI varchar(2),
	@PLUS varchar(2)
)
RETURNS varchar(16)
AS
BEGIN
	DECLARE @return varchar(16)
	IF (@TYAKUDORI = '0') AND (@PLUS = '0')
		SET @return = '-'
	ELSE 
		SET @return = @TYAKUDORI+ '+' +@PLUS
	RETURN @return
END
GO

